
// provide font size in rem, with px fallback
@mixin fontsize($size: 24, $base: 16) {
  font-size: round($size) + pt;
}

@mixin entry($t, $fc: $primary, $tc: $text, $bc: $fill) {
//
// entry
//

  @if $t == normal {
    color: $tc;
    background-color: $bc;
    border-radius: $circular_radius;
    border: 2px solid transparent;
    box-shadow: none;
  }

  @if $t == hover {
    color: $tc;
    border-color: $track;
    background-color: $bc;
  }

  @if $t == focus {
    color: $tc;
    border-color: $fc;
    background-color: $bc;
    box-shadow: none;
  }

  @if $t == insensitive {
    background-color: $bc;
    color: rgba($tc, 0.35);
    border-color: transparent;
  }

  @if $t == flat-normal {
    background-color: $bc;
    border-radius: 0;
    border: none;
    box-shadow: inset 0 -1px rgba($tc, 0.15);
    color: $tc;
  }

  @if $t == flat-hover {
    background-color: $bc;
    box-shadow: inset 0 -1px rgba($tc, 0.35);
    color: $tc;
  }

  @if $t == flat-focus {
    border: none;
    background-color: $bc;
    box-shadow: inset 0 -2px $fc;
    color: $tc;
  }

  @if $t == flat-insensitive {
    border: none;
    background-color: $bc;
    color: rgba($tc, 0.35);
  }
}

@mixin button($t, $fc: $primary, $tc: $text, $bc: $base) {
//
// button
//

  @if $t == normal {
    color: $tc;
    background-color: $bc;
    box-shadow: none !important;
  }

  @if $t == focus {
    color: $tc;
    background-color: overlay($bc, focus);
    box-shadow: none !important;
  }

  @if $t == hover {
    color: $tc;
    background-color: overlay($bc, hover);
    box-shadow: none !important;
  }

  @if $t == active {
    color: $tc;
    background-color: overlay($bc, active);
    box-shadow: none !important;
  }

  @if $t == insensitive {
    color: rgba($tc, 0.35);
    background-color: $bc;
    box-shadow: none !important;
  }

  @if $t == flat-normal {
    color: $tc;
    background-color: transparent;
    box-shadow: none !important;
  }

  @if $t == flat-focus {
    color: $tc;
    background-color: overlay($bc, focus);
    box-shadow: none !important;
  }

  @if $t == flat-hover {
    color: $tc;
    background-color: overlay($bc, hover);
  }

  @if $t == flat-active {
    color: $tc;
    background-color: overlay($bc, active);
    box-shadow: none !important;
  }

  @if $t == flat-insensitive {
    background-color: transparent;
    color: rgba($tc, 0.35);
    box-shadow: none !important;
  }
}
